package mark.tom.gear.base.utils

import android.content.Context
import android.text.TextUtils
import tech.gujin.toast.ToastUtil

/**
 * @Description: Toast工具类
 * @Author: ttmk110@163.com
 * @Package: mark.tom.gear.base.utils
 * @Date: 2021/4/2
 * @Copyright: 版权归 Mark 所有
 * <ModifyLog>
 * @ModifyContent:
 * @Author:
 * @Date:
 * </ModifyLog>
 */
object ToastUtil {

    /**
     * Description: 初始化Toast工具
     * Copyright: Copyright (c) 2021
     * Project: Gear
     * Author: ttmk110@163.com
     * Date: 2021/4/2 17:08
     */
    fun initialize(mContext: Context) {
        ToastUtil.initialize(mContext, ToastUtil.Mode.REPLACEABLE)
    }

    /**
     * Description: Show a toast
     * Copyright: Copyright (c) 2021
     * Project: Gear
     * Author: ttmk110@163.com
     * Date: 2021/4/2 17:10
     */
    fun showToast(mText: String?, durationLong: Boolean = false) {
        if (TextUtils.isEmpty(mText)) {
            return
        }
        ToastUtil.show(mText, durationLong)
    }
}